package com.woniu.platform.contorller;

import com.woniu.platform.entity.vo.PlatformRepay;
import com.woniu.platform.service.PlatformRepyService;
import com.woniu.util.utils.HttpResult;
import com.woniu.util.utils.RequestParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("repay")
public class PlatformRepayController {
    @Autowired
    private PlatformRepyService platformRepyService;

    /**
     * 分页查询待还给用户的信息
     * @param param
     * @return
     */
    @PostMapping("list")
    public HttpResult queryRepayList(@RequestBody RequestParam<PlatformRepay> param){
        return platformRepyService.queryRepyList(param);
    }

    /**
     * 还钱给用户
     * @param repay
     * @return
     */
    @PostMapping("afterrepay")
    public HttpResult afterRepy(@RequestBody List<PlatformRepay> repay){
        return platformRepyService.afterRepy(repay);
    }
}
